<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>住房公积金</title>
    <script>
        function input(flag) {
            let money = prompt(flag ? '请输入正确的工资数额' : '请输入您的税前工资');
            console.log(money);
            // console.log(!/^[0-9]*$/i.test(money));
            if (!/^[0-9]*$/i.test(money)) {
                input(true);
                return;
            }
            let result = parseInt(money) * 0.1 * 2;
            alert(`您的税前工资为${money}，对应住房公积金的缴纳额为${result}`)
        }
        input();
    </script>
</head>
<body>
    
</body>
</html>